package com.duolun.channel.demo;

import com.duolun.channel.client.ChannelNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhuwj.cn
 */
@RestController
@SpringBootApplication
public class ChannelDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(ChannelDemoApplication.class, args);
    }

    @Autowired
    private ChannelNode channelNode;

    @GetMapping("/push")
    public String push(String message){
        channelNode.push(message);
        return "ok";
    }
}
